package com.company.cloud.club.modules.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.company.cloud.club.modules.db.dao.ClubMemberMapper;
import com.company.cloud.club.modules.db.domain.ClubMember;
import com.company.cloud.club.modules.db.domain.UserInfo;
import com.company.cloud.club.modules.service.ClubMemberService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * *****************************************************************************
 * <p>
 * 功能名           ：com.qxzychina..service.impl
 * 系统名           ：
 * <p>
 * *****************************************************************************
 * Modification History
 * <p>
 * Date        Name                    Reason for Change
 * ----------  ----------------------  -----------------------------------------
 * 2020/7/18     zhangxu                 Created
 */
@Service
public class ClubMemberServiceImpl extends ServiceImpl<ClubMemberMapper, ClubMember> implements ClubMemberService {

    @Override
    public boolean deleteClubMember(String clubId, String type) {
        return baseMapper.deleteClubMember(clubId, type);
    }

    @Override
    public List<ClubMember> selectByClubId(String clubId) {
        return baseMapper.selectByClubId(clubId);
    }

    @Override
    public List<ClubMember> pageByClubId(String clubId, Integer begin, Integer pageSize) {
        return baseMapper.pageByClubId(clubId, begin, pageSize);
    }

    @Override
    public Integer countByClubId(String clubId) {
        return baseMapper.countByClubId(clubId);
    }

    @Override
    public Boolean isColled(String clubId, Integer currentUserId) {
        return baseMapper.isColled(clubId, currentUserId) != 0;
    }

    @Override
    public ClubMember selectByClubIdAndUserId(String resId, Integer userId) {
        return baseMapper.selectByClubIdAndUserId(resId, userId);
    }

    @Override
    public void removeMember(String resId, Integer currentUserId) {
        baseMapper.removeMember(resId, currentUserId);
    }

    @Override
    public List<ClubMember> selectByUserId(Integer userId) {
        return baseMapper.selectByUserId(userId);
    }

    @Override
    public List<ClubMember> pageByUserId(Integer uid, Integer begin, Integer pageSize) {
        return baseMapper.pageByUserId(uid, begin, pageSize);
    }

    @Override
    public int countByUserId(Integer uid) {
        return baseMapper.countByUserId(uid);
    }

}